<?php

require_once('lib/Schedule.php');
require_once('lib/Invite.php');
require_once('lib/Check.php');
require_once('lib/Statistics.php');

define('REPORT_DAYS', 7);

$dates = array();
for ($i = 0; $i < REPORT_DAYS; $i++)
    $dates[] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') -$i, date('Y')));

print "<pre>\n";
print "- Schedule:\n";
print "  - count total: ".Schedule::get_count_total()."\n";
$s_counts = Schedule::get_count_all();
print "  - count all: ".array_sum($s_counts)."\n";
print "    - count fulltime:  ".$s_counts[0]."\n";
print "    - count daytime:   ".$s_counts[1]."\n";
print "    - count nighttime: ".$s_counts[2]."\n";
print "  - count daily:\n";
foreach($dates as $target_date) {
$s_d_counts = Schedule::get_count_daily($target_date);
print "    - ".$target_date.":\n";
print "      - all: ".array_sum($s_d_counts)."\n";
print "        - fulltime:  ".$s_d_counts[0]."\n";
print "        - daytime:   ".$s_d_counts[1]."\n";
print "        - nighttime: ".$s_d_counts[2]."\n";
}
print "  - count changes daily:\n";
foreach($dates as $target_date) {
print "    - date: ".$target_date."\n";
$stat = new Statistics('schedules', $target_date);
print "      - inserts: ".$stat->insert."\n";
print "      - updates: ".$stat->update."\n";
print "      - deletes: ".$stat->delete."\n";
}
print "- Invite:\n";
print "  - count total: ".Invite::get_count_total()."\n";
$i_counts = Invite::get_count_all();
print "  - count all sum: ".array_sum($i_counts)."\n";
print "    - count all notify: ".$i_counts['notification']."\n";
print "    - count all diary:  ".$i_counts['diary']."\n";
print "    - count all n/a:    ".$i_counts['']."\n";
print "  - count daily:\n";
foreach($dates as $target_date) {
$i_d_counts = Invite::get_count_daily($target_date);
print "    - ".$target_date.":\n";
print "      - sum: ".array_sum($i_d_counts)."\n";
print "        - notify: ".$i_d_counts['notification']."\n";
print "        - diary:  ".$i_d_counts['diary']."\n";
print "        - n/a:    ".$i_d_counts['']."\n";
}
print "- Check:\n";
print "  - count total:  ".Check::get_count_total()."\n";
print "  - count all:    ".Check::get_count_all()."\n";
print "  - count all uu: ".Check::get_count_all_uu()."\n";
print "  - count daily:\n";
foreach($dates as $target_date)
print "    - ".$target_date.": ".Check::get_count_daily($target_date)."\n";
print "  - count daily uu:\n";
foreach($dates as $target_date)
print "    - ".$target_date.": ".Check::get_count_daily_uu($target_date)."\n";
print "</pre>\n";

?>
